package com.meiyue.bean.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_login", schema = "test_yuedao", catalog = "")
public class TestLoginEntity {
    private int id;
    private String name;
    private String cell;
    private String authcode;
    private Timestamp authcodeDatetime;
    private String sessionid;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name", nullable = false, length = 100)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "cell", nullable = false, length = 20)
    public String getCell() {
        return cell;
    }

    public void setCell(String cell) {
        this.cell = cell;
    }

    @Basic
    @Column(name = "authcode", nullable = true, length = 6)
    public String getAuthcode() {
        return authcode;
    }

    public void setAuthcode(String authcode) {
        this.authcode = authcode;
    }

    @Basic
    @Column(name = "authcode_datetime", nullable = true)
    public Timestamp getAuthcodeDatetime() {
        return authcodeDatetime;
    }

    public void setAuthcodeDatetime(Timestamp authcodeDatetime) {
        this.authcodeDatetime = authcodeDatetime;
    }

    @Basic
    @Column(name = "sessionid", nullable = true, length = 128)
    public String getSessionid() {
        return sessionid;
    }

    public void setSessionid(String sessionid) {
        this.sessionid = sessionid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestLoginEntity that = (TestLoginEntity) o;

        if (id != that.id) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (cell != null ? !cell.equals(that.cell) : that.cell != null) return false;
        if (authcode != null ? !authcode.equals(that.authcode) : that.authcode != null) return false;
        if (authcodeDatetime != null ? !authcodeDatetime.equals(that.authcodeDatetime) : that.authcodeDatetime != null)
            return false;
        if (sessionid != null ? !sessionid.equals(that.sessionid) : that.sessionid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (cell != null ? cell.hashCode() : 0);
        result = 31 * result + (authcode != null ? authcode.hashCode() : 0);
        result = 31 * result + (authcodeDatetime != null ? authcodeDatetime.hashCode() : 0);
        result = 31 * result + (sessionid != null ? sessionid.hashCode() : 0);
        return result;
    }
}
